﻿using UnityEngine;
using System.Collections;

public class AutoDestroyParticleSystem : MonoBehaviour 
{
    private ParticleSystem _particleSystem;
	
	void Start () 
    {
        _particleSystem = GetComponent<ParticleSystem>();
	}
	
	
	void Update () 
    {
        if (_particleSystem.isPlaying)
            return;

        Destroy(gameObject);
	
	}
}
